
/*
 * @Author: GuitarXiaohe && 2205227953@qq.com
 * @Date: 2024-01-15 15:42:37
 * @LastEditors: GuitarXiaohe && 2205227953@qq.com
 * @LastEditTime: 2024-01-15 15:43:20
 * @FilePath: /umi/src/api/login.ts
 * @Description: 登录
 * QQ:2205227953,邮箱:2205227953@qq.com
 * Copyright (c) 2024 by GuitarXiaohe, All Rights Reserved. 
 */
import request from '@/utils/request'

// 登录方法
export function login (data:object) {
  return request({
    url: '/login',
    headers: {
      isToken: false
    },
    method: 'POST',
    data
  })
}

// 注册方法
export function register (data:object) {
  return request({
    url: '/system/register',
    headers: {
      isToken: false
    },
    method: 'POST',
    data
  })
}

// 获取用户详细信息
export function getInfo () {
  return request({
    url: '/getInfo',
    method: 'GET'
  })
}

// 退出方法
export function logout () {
  return request({
    url: '/logout',
    method: 'DELETE'
  })
}

// 获取验证码
export function getCodeImg () {
  return request({
    url: '/captchaImage',
    headers: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}